function [Ff_1,ff_1,Fi_1,fi_1]=solve_wage_offer_dist(Par1,wf_1,wi_1,n)

alphaf=Par1(7)
betaf=Par1(8)
alphai=Par1(9)
betai=Par1(10)

% solve wage offer distributions
wf_1_n=(wf_1-wf_1(1))/(wf_1(n)-wf_1(1));
Ff_1=betainc(wf_1_n,alphaf,betaf);
ff_1=[eps;Ff_1(2:n)-Ff_1(1:n-1)];

wi_1_n=(wi_1-wi_1(1))/(wi_1(n)-wi_1(1));
Fi_1=betainc(wi_1_n,alphai,betai);
fi_1=[eps;Fi_1(2:n)-Fi_1(1:n-1)];

Ff_1=1-Ff_1;
Fi_1=1-Fi_1;

end

